package javas.net;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.net.MulticastSocket;

public class TestMulticastSocket {
	private static int PORT = 10000;
	
	public static void main(String[] args) throws IOException {
		InetAddress group = InetAddress.getByName("239.0.0.0");
		MulticastSocket socket = new MulticastSocket(PORT);
		socket.setTimeToLive(0);
        socket.joinGroup(group);
        
        String msg = "��������鲥��over~";
        byte[] data = msg.getBytes();
        DatagramPacket hi = new DatagramPacket(data, data.length, group, PORT);
        socket.send(hi);
        socket.close();
        System.out.println("���ͳɹ�!");
	}

}
